﻿<Application 
    x:Class="Coding4Fun.UsbCannon.Phone.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"       
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

    <!--Application Resources-->
    <Application.Resources>
		<Style x:Key="ButtonStyle_Fire" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2">
											<VisualTransition.GeneratedEasingFunction>
												<CubicEase EasingMode="EaseInOut"/>
											</VisualTransition.GeneratedEasingFunction>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<DoubleAnimation Duration="0" To="4" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="UXGraphics"/>
											<ColorAnimation Duration="0" To="#26000000" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="UXShader"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Grid x:Name="UXGraphics" RenderTransformOrigin="0.5,0.5">
								<Grid.RenderTransform>
									<CompositeTransform/>
								</Grid.RenderTransform>
								<Image x:Name="UXImage" Source="Resources/FireButton_Plain.png" Stretch="Fill" Width="145" Height="145" RenderTransformOrigin="0.5,0.5">
									<Image.RenderTransform>
										<CompositeTransform/>
									</Image.RenderTransform>
								</Image>
								<Ellipse x:Name="UXShader" Fill="#00000000" HorizontalAlignment="Center" VerticalAlignment="Center" Width="128" Height="128"/>
							</Grid>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <!--<Setter Property="Width" Value="Auto"/>
			<Setter Property="Height" Value="Auto"/>-->
		</Style>
		<Style x:Key="PhoneButtonBase" TargetType="ButtonBase">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
			<Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
			<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
			<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMediumLarge}"/>
			<Setter Property="Padding" Value="10,3,10,5"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="ButtonBase">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneBackgroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneForegroundBrush}"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentContainer">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}"/>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="ButtonBackground">
												<DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Margin="{StaticResource PhoneTouchTargetOverhang}">
								<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Style x:Key="PhoneRadioButtonCheckBoxBase" BasedOn="{StaticResource PhoneButtonBase}" TargetType="ToggleButton">
			<Setter Property="Background" Value="{StaticResource PhoneBorderBrush}"/>
			<Setter Property="BorderBrush" Value="{StaticResource PhoneBorderBrush}"/>
			<Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
			<Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
			<Setter Property="HorizontalContentAlignment" Value="Left"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="0"/>
		</Style>
		<Style x:Key="CheckBoxStyle_LeftArrow" TargetType="CheckBox">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="CheckBox">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2">
											<VisualTransition.GeneratedEasingFunction>
												<CubicEase EasingMode="EaseInOut"/>
											</VisualTransition.GeneratedEasingFunction>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OnLight"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
									<VisualState x:Name="Indeterminate"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="83" Source="Resources/Arrow_Left_Off.png" Stretch="Fill" VerticalAlignment="Top" Width="83"/>
							<Image x:Name="OnLight" HorizontalAlignment="Left" Height="83" Source="Resources/Arrow_Left_On.png" Stretch="Fill" VerticalAlignment="Top" Width="83" Opacity="0"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="HorizontalAlignment" Value="Right"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
			<Setter Property="IsEnabled" Value="False"/>
		</Style>
		<Style x:Key="CheckBoxStyle_RightArrow" TargetType="CheckBox">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="CheckBox">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2">
											<VisualTransition.GeneratedEasingFunction>
												<CubicEase EasingMode="EaseInOut"/>
											</VisualTransition.GeneratedEasingFunction>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OnLight"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
									<VisualState x:Name="Indeterminate"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image Height="83" Source="Resources/Arrow_Right_Off.png" Stretch="Fill" Width="83"/>
							<Image x:Name="OnLight" Height="83" Source="Resources/Arrow_Right_On.png" Stretch="Fill" Width="83" Opacity="0"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="HorizontalAlignment" Value="Left"/>
			<Setter Property="VerticalAlignment" Value="Center"/>
			<Setter Property="IsEnabled" Value="False"/>
		</Style>
		<Style x:Key="CheckBoxStyle_UpArrow" TargetType="CheckBox">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="CheckBox">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2">
											<VisualTransition.GeneratedEasingFunction>
												<CubicEase EasingMode="EaseInOut"/>
											</VisualTransition.GeneratedEasingFunction>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OnLight"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
									<VisualState x:Name="Indeterminate"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="83" Source="Resources/Arrow_Up_Off.png" Stretch="Fill" VerticalAlignment="Top" Width="84"/>
							<Image x:Name="OnLight" HorizontalAlignment="Left" Height="83" Source="Resources/Arrow_Up_On.png" Stretch="Fill" VerticalAlignment="Top" Width="84" Opacity="0"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="HorizontalAlignment" Value="Center"/>
			<Setter Property="VerticalAlignment" Value="Bottom"/>
			<Setter Property="IsEnabled" Value="False"/>
		</Style>
		<Style x:Key="CheckBoxStyle_DownArrow" TargetType="CheckBox">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="CheckBox">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0"/>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed"/>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
								<VisualStateGroup x:Name="CheckStates">
									<VisualStateGroup.Transitions>
										<VisualTransition GeneratedDuration="0:0:0.2">
											<VisualTransition.GeneratedEasingFunction>
												<CubicEase EasingMode="EaseInOut"/>
											</VisualTransition.GeneratedEasingFunction>
										</VisualTransition>
									</VisualStateGroup.Transitions>
									<VisualState x:Name="Checked">
										<Storyboard>
											<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OnLight"/>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Unchecked"/>
									<VisualState x:Name="Indeterminate"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image HorizontalAlignment="Left" Height="83" Source="Resources/Arrow_Down_Off.png" Stretch="Fill" VerticalAlignment="Top" Width="84"/>
							<Image x:Name="OnLight" HorizontalAlignment="Left" Height="83" Source="Resources/Arrow_Down_On.png" Stretch="Fill" VerticalAlignment="Top" Width="84" Opacity="0"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
			<Setter Property="HorizontalAlignment" Value="Center"/>
			<Setter Property="VerticalAlignment" Value="Top"/>
			<Setter Property="IsEnabled" Value="False"/>
		</Style>
		<Style x:Key="ButtonStyle_Settings" TargetType="Button">
			<Setter Property="Background" Value="Transparent"/>
			<Setter Property="Padding" Value="10,3,10,5"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid Background="Transparent">
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="MouseOver"/>
									<VisualState x:Name="Pressed">
										<Storyboard>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Visible</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
											<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UXImage">
												<DiscreteObjectKeyFrame KeyTime="0">
													<DiscreteObjectKeyFrame.Value>
														<Visibility>Collapsed</Visibility>
													</DiscreteObjectKeyFrame.Value>
												</DiscreteObjectKeyFrame>
											</ObjectAnimationUsingKeyFrames>
										</Storyboard>
									</VisualState>
									<VisualState x:Name="Disabled"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Image x:Name="UXImage" HorizontalAlignment="Right" Height="78" Source="Resources/GearButton.png" Stretch="Fill" VerticalAlignment="Bottom" Width="78"/>
							<Image x:Name="image" HorizontalAlignment="Right" Height="78" Source="Resources/GearButton_Pressed.png" Stretch="Fill" VerticalAlignment="Bottom" Width="78" Visibility="Collapsed"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService 
            Launching="Application_Launching" Closing="Application_Closing" 
            Activated="Application_Activated" Deactivated="Application_Deactivated"/>
    </Application.ApplicationLifetimeObjects>

</Application>
